package com.example.li.myapplication.touchevent;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.TextView;

/**
 * Created by ly on 2016/10/14 14:09.
 */

public class ChildView extends TextView{
    public ChildView(Context context) {
        this(context, null);
    }

    public ChildView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ChildView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.e("执行", "Child--dispatchTouchEvent: "+ super.dispatchTouchEvent(ev));
        return super.dispatchTouchEvent(ev);
    }


    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.e("执行", "Child--onTouchEvent: "+super.onTouchEvent(event));
        return super.onTouchEvent(event);
    }
}
